<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="admin"/>
        <title>Site List</title>
    </head>
    <body>
        <div class="body">
            <h1>Site List</h1>
            <g:if test="${flash.message}">
                <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table class="full">
                    <thead>
                        <tr>

                            <g:sortableColumn property="id" title="Id"/>

                            <g:sortableColumn property="title" title="标题"/>

                            <g:sortableColumn property="author.name" title="拥有者"/>

                            <th>操作</th>


                        </tr>
                    </thead>
                    <tbody>
                        <g:each in="${siteInstanceList}" status="i" var="siteInstance">
                            <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

                                <td><g:link action="show" id="${siteInstance.id}">${fieldValue(bean: siteInstance, field: 'id')}</g:link></td>

                                <td>${fieldValue(bean: siteInstance, field: 'title')}</td>

                                <td><g:link controller="home" action="blog" id="${siteInstance.author.id}">${fieldValue(bean: siteInstance, field: 'author.name')}</g:link></td>

                                <td><g:formatBoolean boolean="${siteInstance.enabled}" /><g:link controller="site" action="goswitch" id="${siteInstance.id}">${siteInstance.enabled?"关闭":"开启"}
                            </g:link></td>

                            </tr>
                        </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${Site.count()}"/>
            </div>
        </div>
    </body>
</html>
